/*
 * messages.h
 *
 *  Created on: Jul 17, 2013
 *      Author: m
 */

#ifndef MESSAGES_H_
#define MESSAGES_H_

#include <iostream>
#include "application_common.h"
#include "Visitor.h"
#include "Ticket.h"

namespace application
{

struct BusStationRequest
{
    FixedSizeString m_replyTo;
    SerializedVisitor m_visitor;
};

typedef enum { SUCCESS, INVALID_TICKET, UNKNOWN_ERROR } busStationReplyResult_t;

struct BusStationReply
{
    busStationReplyResult_t m_result;
    SerializedTicket m_ticket;
};

struct NewPassengerNotification
{
    int m_stubVariable; // Solamente la agrego para asegurarme que el mensaje ocupa algo de espacio.
};

struct PassengerToLoad
{
    SerializedVisitor m_visitor;
    FixedSizeString m_replyTo;
};

struct LoadRequest
{
    FixedSizeString m_busName;
    FixedSizeString m_replyTo;
};

struct LoadReply
{
    SerializedVisitor m_visitor;
    FixedSizeString m_replyTo;
};

typedef enum{ UNLOAD_DESTINATION_REACHED, UNLOAD_INVALID_TICKET } busUnloadReason;

struct UnloadRequest
{
    busUnloadReason m_reason;
    SerializedTicket m_ticket;
};

struct UnloadReply
{
    SerializedVisitor m_visitor;
};

struct EntranceRequest
{
    SerializedVisitor m_visitor;
    FixedSizeString m_replyTo;
};

} /* namespace business */

#endif /* MESSAGES_H_ */
